import { atom } from 'jotai';
import { Leafer, App } from 'leafer-ui';
import { Editor } from '@leafer-in/editor/src';


export const isLeaferDragAtom = atom(true); // 当左侧改变大小时，控制画布的拖动事件不执行
export const leaferAtom = atom<Leafer | null>(null);
export const selectedBtnAtom = atom('');
export const editorAtom = atom<Editor | null>(null);
export const appAtom = atom<App | null>(null);


export const testAtom = atom(null, (get) => {
  return get(leaferAtom)?.toJSON();
});
